﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework2
{
    internal class CreditAccount : Account
    {
        public decimal CreditLimit { get; }

        public CreditAccount(string accountNumber, string password, decimal initialBalance, decimal creditLimit)
            : base(accountNumber, password, initialBalance)
        {
            CreditLimit = creditLimit;
        }
        public override bool Withdraw(decimal amount)
        {
            if (Balance + CreditLimit >= amount)
            {
                Balance -= amount;
                return true;
            }
            return false;
        }
    }
}
